package com.chinasofti.hashset02;

import java.util.HashSet;

public class HashsetDemo02 {
    public static void main(String[] args) {
        HashSet<Student> set = new HashSet<Student>();

        Student s1 = new Student("zhangsan",18);
        Student s2 = new Student("zhangsan",18);
        Student s3 = new Student("wangwu",20);

        set.add(s1);
        set.add(s2);
        set.add(s3);

        for (Student s :set){
            System.out.println(s);
        }
    }
}
